//入口文件
import Vue from 'vue'

//导入App根组件
import app from './App.vue'

//导入格式化时间的插件
import moment from 'moment'

//定义全局过滤器
Vue.filter('dataFormat',function(dataStr,pattern='YYYY-MM-DD HH:mm:ss'){
  return moment(dataStr).format(pattern)
})

//设置请求根路径
// Vue.http.options.root = '根路径地址'

//导入并安装路由
import VueRouter from 'vue-router';
Vue.use(VueRouter)

//导入vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)

//引入mint-ui
import { Header,Swipe, SwipeItem, Button } from 'mint-ui';
Vue.component(Header.name, Header);
//轮播图
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);

//导入router.js
import router from './router'

//引入min的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'
import './lib/mui/fonts/mui-icons-extra.ttf'

// import Mock from 'mockjs' 
require ('./mock')

var vm = new Vue({
  el:'#app',
  render:h=>h(app),
  router  //挂载路由到vm实例中
}) 